#include <glib.h>
#include "common.h"

void display_list(GSList *list)
{
	GSList *it = NULL;
	int  i = 0;
	/* 遍历链表 */
	for (it = list; it; it = it->next) {
		g_printf("[%d] [%p] %s\n", ++i, it->data, it->data);

	}

	g_printf("\n");

}

int main(int argc, char *argv[])
{
	GSList *list = NULL;

	list = g_slist_append(list, "first");
	list = g_slist_append(list, "second");

	//list = NULL;
	display_list(list);

	g_slist_free(list);

	//list = g_slist_append(list, g_strdup_printf("%s","first"));
	//list = g_slist_append(list, g_strdup_printf("%s","second"));
	//g_slist_free_full(list, g_free);
	return 0;

} 
